import axios from 'axios'
const instance = axios.create()
import qs from 'qs'
interface Response{
config: any;
[x: string]: any;
    code: number;
    msg: string;
    data?: any;
}
const myaxios = {
    get(url:string,params?:object):Promise<Response>{
        return instance({
            url,
            method:'get',
            params
        })
    },
    post(url:string, params?:object):Promise<Response>{
        return instance({
            url,
            method: 'post',
            data: qs.stringify(params)
        })
    }
}

export default myaxios